Publish and Subscribe (pub/sub) is an effective way of disseminating information to multiple users. Pub/Sub applications can help to simplify the task of getting business messages and transactions to a wide, dynamically changing and potentially large audience in a timely manner. In a pub/sub system, publishers are not concerned with where their messages are going, and subscribers are not interested in where the messages they receive have come from. Instead, a message broker typically assures the integrity of the message source and manages the distribution of a message according to subscriptions registered in the message broker.
Message “topic strings” typically provide the key to the delivery of messages between publishers and subscribers. With reference to a pub/sub system (100) as shown in FIG. 1A, instead of including a specific destination address in each message, a publisher (105) assigns a topic string to a message. A message broker (110) comprises a matching engine (115) for matching a topic string of a published message with a list of subscribers (120) who have subscribed to receive messages that are published to that topic string. In response to a match, the message broker (110) sends the published message to the subscriber (120).
Topic strings are often associated with a hierarchical structure, known as a “topic tree” having a number of “topic nodes.” A topic node can have an associated “topic object” that can be administered. The topic object comprises one or more attributes and a topic string itself (wherein it is possible for the topic string to be set to “null”).
An example of a topic tree is shown in FIG. 1B, wherein the topic tree comprises a root node having an associated topic string (i.e. “UK”). It should be understood that in some implementations, the root node can have a null topic string. A topic string can be created by aggregating topic strings of topic nodes from one or more levels in the topic tree. Levels of the associated topic string are separated by a “/” character. In the example depicted in FIG. 1B, the format of a fully specified topic string is “root/level2/level3”.
Wildcard topic strings are typically provided for in a pub/sub system. For example, with reference to FIG. 1B, a subscription can be made to a wildcard topic string e.g. “UK/#”, (where “#” denotes a wildcard character), such that the associated subscriber receives each message that has a topic string prefixed with the portion “UK”. It should be understood that a wildcard character can represent any character and any number of characters. While the use of wildcard topic strings provides for an efficient method for allowing a subscriber to receive messages, further flexibility is required.